package com.pan.api.config;

public abstract class ConfigUnit<T> {
    private T obj;//lazy load
    protected abstract T createNewObjectInstance();
    protected ConfigUnit(){}
    public T get() {
        if (obj == null) {
            obj = createNewObjectInstance();
        }
        return obj;
    }

    public void set(T obj) {
        this.obj = obj;
    }
}